//
//  ViewController.m
//  Exam10-2
//
//  Created by 孙晓晔 on 2017/4/10.
//  Copyright © 2017年 孙晓晔. All rights reserved.
//

#import "ViewController.h"
#import "PlayerView.h"

@interface ViewController ()
@property(nonatomic,strong)PlayerView *playerView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _playerView = [[PlayerView alloc]init];
    
    NSString *strPath = [[NSBundle mainBundle] pathForResource:@"bb" ofType:@"mp4"];
    
    NSURL *url = [NSURL fileURLWithPath:strPath];
    
//    NSURL *url = [NSURL URLWithString:@"http://dl.jiapuwang.net/22.mov"];
//
    [_playerView playerWithURL:url];
    
    [self.view addSubview:_playerView];
}

-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
    
    [self.playerView resetFrame:size];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
